// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 

package com.nnee.p_pr.p_activity;

import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.database.ContentObserver;
import android.database.Cursor;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.webkit.CookieManager;
import android.webkit.CookieSyncManager;
import android.widget.AdapterView;
import android.widget.ListView;
import com.nnee.p_b.p_a.cls_d;
import com.nnee.p_fk.cls_ActivityEx;
import com.nnee.p_fk.cls_k;
import com.nnee.p_pr.p_atom.cls_b;
import com.nnee.p_pr.p_c.cls_l;
import com.nnee.p_pr.p_d.cls_c;
import java.util.ArrayList;
import java.util.List;

// Referenced classes of package com.nnee.p_pr.p_activity:
//            co, MBlogBindActivity, fm, cp, 
//            fi, fn, fl

public class cls_PRISActivityWBSetting extends cls_ActivityEx
    implements android.widget.AdapterView.OnItemClickListener
{

    public cls_PRISActivityWBSetting()
    {
        d = null;
    }

    public static void a(Context context)
    {
        context.startActivity(new Intent(context, com.nnee.p_pr.p_activity.cls_PRISActivityWBSetting.class));
    }

    static void a(cls_PRISActivityWBSetting prisactivitywbsetting)
    {
        prisactivitywbsetting.c();
    }

    static void a(cls_PRISActivityWBSetting prisactivitywbsetting, cls_co co1)
    {
        prisactivitywbsetting.b(co1);
    }

    private void a(co co1)
    {
        f = co1;
        cls_MBlogBindActivity.a(this, co1.c);
    }

    public static boolean a(Context context, cls_b b1)
    {
        boolean flag = true;
        if(b1 != cls_b.cNetEaseMblog) goto _L2; else goto _L1
_L1:
        if(l.b(context, com.nnee.p_b.p_a.cls_d.h().c(), flag) != null) goto _L4; else goto _L3
_L3:
        int j;
        int i1;
        j = 0x7f0a0189;
        i1 = ((flag) ? 1 : 0);
_L6:
        if(i1 != 0)
        {
            android.app.AlertDialog.Builder builder = new android.app.AlertDialog.Builder(context);
            builder.setIcon(0x7f02008c);
            String s = context.getString(0x7f0a0186);
            Object aobj[] = new Object[flag];
            aobj[0] = context.getString(j);
            builder.setTitle(String.format(s, aobj));
            builder.setMessage(0x7f0a0187);
            fm fm1 = new fm(b1, context);
            builder.setPositiveButton(0x7f0a0188, fm1);
            builder.setNegativeButton(0x7f0a0105, fm1);
            builder.show();
        } else
        {
            flag = false;
        }
        return flag;
_L2:
        if(b1 == cls_b.bSinaMblog && l.b(context, com.nnee.p_b.p_a.cls_d.h().c(), 3) == null)
        {
            j = 0x7f0a018a;
            i1 = ((flag) ? 1 : 0);
            continue; /* Loop/switch isn't completed */
        }
_L4:
        j = 0;
        i1 = 0;
        if(true) goto _L6; else goto _L5
_L5:
    }

    static Cursor b(cls_PRISActivityWBSetting prisactivitywbsetting)
    {
        return prisactivitywbsetting.d;
    }

    private void b(co co1)
    {
        f = co1;
        showDialog(1);
    }

    static int c(cls_PRISActivityWBSetting prisactivitywbsetting)
    {
        return prisactivitywbsetting.h;
    }

    private void c()
    {
        if(f == null)
            break MISSING_BLOCK_LABEL_22;
        l.a(this, f.c);
        e();
_L1:
        return;
        Exception exception;
        exception;
        exception.printStackTrace();
          goto _L1
    }

    private void e()
    {
        CookieSyncManager.createInstance(getApplicationContext());
        CookieManager.getInstance().removeAllCookie();
        CookieSyncManager.getInstance().sync();
    }

    void a_()
    {
        d.requery();
        boolean flag = d.moveToFirst();
        ArrayList arraylist = new ArrayList();
        arraylist.clear();
        for(int j = 0; j < 7; j++)
        {
            co co1 = new co(this, null);
            co1.a = getString(0x7f0a0125);
            co1.d = false;
            co1.c = j + 1;
            arraylist.add(co1);
        }

        if(flag)
            do
            {
                co co2 = (co)arraylist.get(-1 + d.getInt(4));
                if(co2 != null)
                {
                    co2.b = d.getLong(0);
                    co2.a = d.getString(2);
                    co2.d = true;
                    co2.e = d.getString(7);
                    co2.f = d.getString(8);
                }
            } while(d.moveToNext());
        g = new cp(this, this);
        g.a(arraylist);
        g.notifyDataSetChanged();
        c.setAdapter(g);
        c.setOnItemClickListener(this);
    }

    void b()
    {
        c = (ListView)findViewById(0x7f0d0137);
        c.setDivider(k.a(this).b(0x7f0200d9));
        a_();
        setTitle(0x7f0a00f6);
        g(8);
    }

    protected void onCreate(Bundle bundle)
    {
        super.onCreate(bundle);
        setContentView(0x7f030051);
        d = l.a(this);
        e = new fi(this, new Handler());
        d.registerContentObserver(e);
        b();
    }

    protected Dialog onCreateDialog(int j)
    {
        j;
        JVM INSTR tableswitch 1 1: default 20
    //                   1 28;
           goto _L1 _L2
_L1:
        Object obj = super.onCreateDialog(j);
_L4:
        return ((Dialog) (obj));
_L2:
        obj = (new android.app.AlertDialog.Builder(this)).setIcon(0x7f020087).setTitle(0x7f0a0108).setMessage(0x7f0a0109).setPositiveButton(0x7f0a010a, new fn(this)).setNegativeButton(0x7f0a010b, new fl(this)).create();
        if(true) goto _L4; else goto _L3
_L3:
    }

    protected void onDestroy()
    {
        if(d != null)
        {
            d.unregisterContentObserver(e);
            d.close();
        }
        g = null;
        super.onDestroy();
        System.gc();
    }

    public void onItemClick(AdapterView adapterview, View view, int j, long l1)
    {
        if(g != null)
        {
            co co1 = (co)g.getItem(j);
            if(!co1.d)
            {
                com.nnee.p_pr.p_d.cls_c.a(p(), 609, co1.c);
                a(co1);
            }
        }
    }

    public static final int a = 111;
    private static final String b = com.nnee.p_pr.p_activity.cls_PRISActivityWBSetting.class.getCanonicalName();
    private static final int i = 1;
    private ListView c;
    private Cursor d;
    private ContentObserver e;
    private co f;
    private cp g;
    private int h;

}
